﻿using System.Text.RegularExpressions;

namespace XDCCManager.Network.IRC
{
	public static class ChatMessages
	{
		public const string RequestChat = "admin {0} chatme";
		public static readonly Regex ResponseAdmin = new Regex("^ADMIN: (?<reason>.*)$", RegexOptions.Compiled | RegexOptions.ExplicitCapture);

		#region Command messages
		public const string CommandOfferedFiles = "XDL";
//-- Info Commands --
//  HELP             - Shows Help
//  XDL              - Lists Offered Files
//  XDS              - Save XDCC File
//  DCL              - Lists Current Transfers
//  DCLD             - Lists Current Transfers with Details
//  TRINFO n         - Lists Information About Transfer n
//  QUL              - Lists Current Queue
//  IGNL             - Show Ignored List
//  LISTUL           - Shows contents of upload directory
//  CHANL            - Shows channel list with member list
//-- Transfer Commands --
//  CLOSE n          - Cancels Transfer with ID = n
//  CLOSEU n         - Cancels Upload with ID = n
//  RMQ n            - Removes Queue Number n
//  NOMIN n          - Disables Minspeed For Transfer ID n
//  NOMAX n          - Disables Maxspeed For Transfer ID n
//  SEND nick n      - Sends Pack n to nick
//  PSEND <channel> <style> - Sends <style> (full|minimal|summary) XDCC LIST to <channel>
//  QSEND            - Sends Out The First Queued Pack
//-- Pack Commands --
//  INFO n           - Show Info for Pack n
//  REMOVE n         - Removes Pack n
//  REMOVEDIR <dir>         - Remove Every File in <dir>
//  RENUMBER x y     - Moves Pack x to y
//  ADD <filename>   - Add New Pack With <filename>
//  ADDDIR <dir>     - Add Every File in <dir>
//  CHFILE n <msg>   - Change File of pack n to <msg>
//  CHDESC n <msg>   - Change Description of pack n to <msg>
//  CHNOTE n <msg>   - Change Note of pack n to <msg>
//  CHMINS n x       - Change min speed of pack n to x KB
//  CHMAXS n x       - Change max speed of pack n to x KB
//  CHGETS n x       - Change the get count of a pack
//-- Misc Commands --
//  MSG <nick> <message> - Send a message to a user
//  MESG <message>   - Sends msg to all users who are transferring
//  MESQ <message>   - Sends msg to all users in a queue
//  IGNORE n <hostmask> - Ignore hostmask (nick!user@host) for n minutes, wildcards allowed
//  UNIGNORE <hostmask> - Un-Ignore hostmask
//  NOSAVE n         - Disables XDCC AutoSave for next n minutes
//  NOSEND n         - Disables XDCC Send for next n minutes
//  NOLIST n         - Disables XDCC List and Plist for next n mins
//  MSGREAD          - Show MSG log
//  MSGDEL           - Delete MSG log
//  RMUL <file>      - Delete a file in the Upload Dir
//  RAW <command>    - Send <command> to server (RAW IRC)
//-- Bot Commands --
//  SERVERS          - Shows the server list
//  JUMP <num>       - Switches to a random server or server <num>
//  SERVQC           - Clears the server send queue
//  STATUS           - Show Useful Information
//  REHASH           - Re-reads config file(s) and reconfigures
//  BOTINFO          - Show Information about the bot status
//  MEMSTAT          - Show Information about memory usage
//  CLEARRECORDS     - Clears transfer, bandwidth, uptime, and total sent
//  REDRAW           - Redraws the Screen
//  DELHIST           - Deletes console history
//  QUIT             - Close this DCC chat
//  CHATME           - Sends you a DCC Chat Request
//  CHATL           - Lists DCC Chat Information
//  CLOSEC n         - Closes DCC Chat with ID = n
//  DEBUG n          - Set Debugging level to n
//  SHUTDOWN <act>   - Shutdown iroffer, <act> is "now", "delayed", or "cancel"
		#endregion

		#region Response messages
		public const string ResponseEnterPassword = "Enter Your Password:";
		public const string ResponseIncorrectPassword = "Incorrect Password";
		public static readonly Regex ResponseStats = new Regex(@"Stat: (?<usedSlots>\d+)/(?<totalSlots>\d+) Sls, (?<inQueue>\d+)/(?<sizeQueue>\d+) Q, (?<recordSpeed>\d+(\.\d+)?)K/s Rcd, (?<serverQueue>\d+) SrQ (Bdw: (?<bandWidth>\d+(\.\d+)?)K, (?<avgSpeed>\d+(\.\d+)?)K/s, (?<recordAvgSpeed>\d+(\.\d+)?)K/s Rcd)", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
		public static readonly Regex ResponseOfferedFilesStart = new Regex(@"^\*\* \d+ packs \*\*", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
		public static readonly Regex ResponseOfferedFilesPack = new Regex(@"^#(?<number>\d+)\s+(?<gets>\d+)x\s+\[\s*(?<size>\d+(.\d+)?(G|M|K)?)\]\s+(?<name>.*)$", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
		public static readonly Regex ResponseOfferedFilesEnd = new Regex(@"^\*\*.*\*\*$", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
//** 2 packs **  12 of 12 slots open, Record: 65.8KB/s
//** Bandwidth Usage ** Current: 0.5KB/s, Cap: 50.0KB/s, Record: 2.5KB/s
//** To request a file type: "/msg offerDCC xdcc send #x" **
//** To request details type: "/msg offerDCC xdcc info #x" **
//#1  4618x [ 55K] iroffer 1.0.1  - Stable (v1.0) version
//#2   361x [ 66K] iroffer 1.1b8  - Experimental (v1.1) version
//** The official iroffer distribution source **
		#endregion
	}
}
